#!/bin/bash
# autonumabench installer

###SHELLPACK preamble autonumabench-install 0
GIT_LOCATION=git://gitorious.org/autonuma-benchmark/autonuma-benchmark.git
MIRROR_LOCATION="$WEBROOT/autonumabench/"

###SHELLPACK parseargBegin
###SHELLPACK parseargEnd

###SHELLPACK git_fetch autonumabench-${VERSION}.tar.gz autonumabench-${VERSION}-installed

# Build
###SHELLPACK build_start autonumabench-${VERSION}-installed
echo 'diff --git a/start_bench.sh b/start_bench.sh
index 101286e..5780b09 100755
--- a/start_bench.sh
+++ b/start_bench.sh
@@ -13,7 +13,9 @@
 
 usage()
 {
-	echo -e "./start_bench.sh [-stnbiA] [-h]"
+	echo -e "./start_bench.sh [-ustnbiA] [-h]"
+	echo -e "\t-x : run numa01 test additionally"
+	echo -e "\t-y : run numa02 test additionally"
 	echo -e "\t-s : run numa02_SMT test additionally"
 	echo -e "\t-t : run numa01_THREAD_ALLOC test additionally"
 	echo -e "\t-b : run *_HARD_BIND tests additionally"
@@ -86,15 +93,20 @@ run_bench()
 {
 	make
 	test_ht
-	TESTNAME=numa01
-	run_test
-	if [ $TALLOC -eq 1 ] ; then
+
+	if [ $NUMA01 -eq 1 ]; then
+		TESTNAME=numa01
+		run_test
+	fi
+	if [ $NUMA01_TALLOC -eq 1 ] ; then
 		TESTNAME=numa01_THREAD_ALLOC
 		run_test
 	fi
-	TESTNAME=numa02
-	run_test
-	if [ $SMT -eq 1 ] ; then
+	if [ $NUMA02 -eq 1 ]; then
+		TESTNAME=numa02
+		run_test
+	fi
+	if [ $NUMA02_SMT -eq 1 ] ; then
 		TESTNAME=numa02_SMT
 		run_test
 	fi
@@ -105,19 +117,27 @@ cleanup()
 	make clean
 }
 
-SMT=0
-TALLOC=0
+NUMA01=0
+NUMA01_TALLOC=0
+NUMA02=0
+NUMA02_SMT=0
 HARDBIND=0
 INVERSEBIND=0
 MOF=0
 
-while getopts "stnbiAmh" opt; do
+while getopts "xystnbiAmh" opt; do
 	case $opt in
+		x)
+			NUMA01=1
+			;;
+		y)
+			NUMA02=1
+			;;
 		s)
-			SMT=1
+			NUMA02_SMT=1
 			;;
 		t)
-			TALLOC=1
+			NUMA01_TALLOC=1
 			;;
 		b)
 			HARDBIND=1
@@ -126,8 +146,10 @@ while getopts "stnbiAmh" opt; do
 			INVERSEBIND=1
 			;;
 		A)
-			SMT=1
-			TALLOC=1
+			NUMA01=1
+			NUMA02=1
+			NUMA02_SMT=1
+			NUMA01_TALLOC=1
 			HARDBIND=1
 			INVERSEBIND=1
 			;;' | patch -p1 || die Failed to patch autonumabench

echo autonumabench installed successfully
